
line = 'asdf fjdk; afed, fjek,asdf, foo'
import re
# r:原始字符串标识符 \s:表示空格符
my_list = re.split(r"[,;\s]\s*",line)
print(my_list)
# ():代表分组 []:捕获
my_list = re.split(r"([,;\s])\s*",line)
print(my_list)

values = my_list[::2]
print(values)
delimiters = my_list[1::2]+['']
print(delimiters)

my_str = ''.join(v+d for v,d in zip(values,delimiters))
print(my_str)

my_list = re.split(r"(?:,|;|\s)\s*", line)
print(my_list)